home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************************
- CStream_Expander.cpp
-
- Copyright © 1994 B-Ray Software. All rights reserved.
- Developed using Symantec C++ 7.0.2 and Symantec's TCL library.
- Portions of this code courtesy Symantec, Inc.
-
- This code may be freely distributed as long as this notice remains. This code
- may not be used in any commercial software without the consent of B-Ray Software.
-
- ---
-
- This file expands most of the Expander classes with the CStream template.
-
- ***********************************************************************************/
- #include <TCLClassInfo.h>
- #include <CStream.h>
-
-
- #include "CExpandorama.h"
- #include "CExpanderPane.h"
-
-
- #pragma template_access public
-
-
- #pragma template PutObject( CStream &, CExpanderPane* )
- #pragma template GetObject( CStream &, CExpanderPane* & )
- #pragma template PutObjectReference( CStream &, CExpanderPane* )
-
- #pragma template PutObject( CStream &, CExpandorama* )
- #pragma template GetObject( CStream &, CExpandorama* & )
- #pragma template PutObjectReference( CStream &, CExpandorama* )
-
-
- /*
- * GetObject - OVERRIDE
- *
- * We need to convert the object from the stream, which is a CPane or CPanorama
- * object, to a CFamily type. This is the only time we cannot determine the class
- * to work from, hence the member() call.
- */
-
- void GetObject( CStream &stream, CFamily *&aChild )
- {
- CExpanderPane *aPane;
-
- GetObject( stream, (CView *)aPane ); // get object from stream
- if ( aPane == NULL ) {
- aChild = NULL; // don't bother with it
- }
- else if ( member( aPane, CExpandorama ) == TRUE ) {
- aChild = ((CExpandorama *)aPane)->PaneToChild(); // CExpandorama derivative
- }
- else {
- aChild = aPane->PaneToChild(); // CExpanderPane derivative
- }
- }
-
-
- /*
- * PutObject - OVERRIDE
- *
- * Convert from the CFamily type to its CPane/CPanorama equivalent. No need to check
- * the class type since we are starting from CFamily.
- */
-
- void PutObject( CStream &stream, CFamily *aChild )
- {
- CPane *aPane = aChild ? aChild->ChildToPane() : NULL;
- PutObject( stream, (CView *)aPane );
- }
-
-
- #include <CStream.tem>
-